import startSearchModel from "@/config/startSearchModel";
import webSite from '@/config/webSite'

export default (srcColumnDicData) => {
  return {
    submitText: '修改',
    labelWidth: 140,
    index: true,
    page: true,
    align: "center",
    menuType: 'menu',
    menuAlign: 'center',
    menuPosition: "right",
    editBtn: true,
    addBtn: true,
    searchIndex: 2,
    searchMenuSpan: 6,
    searchIcon: true,
    column: [
      {
        label: '数据源',
        span: 24,
        prop: 'dataSourceKey',
        type: 'select',
        editDetail: true,
        dicUrl: webSite.baseUrl + "/bpm/sdrServiceApi/listDataSource",
        cascader: ['targetTableName'],
        filterable: true,
        props: {
          label: "dataSourceName",
          value: "dataSourceKey",

        },
        rules: [{
          required: true,
          message: "请选择数据源",
          trigger: "blur"
        }]
      },
      {
        label: '映射模式',
        span: 24,
        prop: 'startMappingMode',
        type: "select",
        dicUrl: webSite.baseUrl + "/bpm/sdrServiceApi/getStartMappingMode",
        search: true,
        rules: [{
          required: true,
          message: "请选择需要映射的目标数据表",
          trigger: "blur"
        }]
      },
      {
        label: '云表单关系列',
        span: 24,
        prop: 'srcColumn',
        type: "select",
        dicData: srcColumnDicData,
        props: {
          label: "label",
          value: "value",
        },
        search: true,
        rules: [{
          required: true,
          message: "请选择当前数据表关系列",
          trigger: "blur"
        }]
      },
      {
        label: '目标数据表',
        span: 24,
        prop: 'targetTableName',
        type: "select",
        searchModel: startSearchModel.LIKE_RIGHT,
        dicUrl: webSite.baseUrl + "/bpm/sdrServiceApi/listTableByDataSourceKey?dataSourceKey={{dataSourceKey}}",
        cascader: ['targetColumn'],
        filterable: true,
        props: {
          label: "tableNameCN",
          value: 'tableName'
        },
        search: true,
        rules: [{
          required: true,
          message: "请选择需要映射的目标数据表",
          trigger: "blur"
        }]
      },

      {
        label: '目标数据表关系列',
        span: 24,
        prop: 'targetColumn',
        type: "select",
        dicUrl: webSite.baseUrl + "/bpm/sdrServiceApi/listTableColumn?dataSourceKey={{dataSourceKey}}&&targetTableName={{targetTableName}}",
        props: {
          label: "label",
          value: 'prop'
        },
        filterable: true,
        rules: [{
          required: true,
          message: "请选择目标数据表关系列",
          trigger: "blur"
        }]
      },


    ]
  }
}

